package com.ssy.lingxi.purchase.repository.online;

import com.ssy.lingxi.purchase.entity.onlinebidding.OnLineBiddingProduct;
import com.ssy.lingxi.purchase.entity.onlinebidding.OnlineMateriel;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* 在线竞价物料明细
* @date 2022/3/10
*/
@Repository
public interface OnLineBiddingProductRepository extends JpaRepository<OnLineBiddingProduct, Long>, QuerydslPredicateExecutor<OnLineBiddingProduct> {

    Page<OnLineBiddingProduct> findByBiddingNoAndOnlineMateriel(String biddingNo, OnlineMateriel materiel, Pageable page);

    Page<OnLineBiddingProduct> findAllByOnlineMaterielAndReportNumber(OnlineMateriel onlineMateriel, Long reportNumber, Pageable page);

    List<OnLineBiddingProduct> findAllByOnlineMaterielAndReportNumber(OnlineMateriel onlineMateriel, Long reportNumber);

    List<OnLineBiddingProduct> findAllByOnlineMateriel(OnlineMateriel onlineMateriel);

    List<OnLineBiddingProduct> findAllByBiddingNoOrderByReportTimeDesc(String biddingNo);
}
